﻿<UserControl x:Class="Notoric.Gui.Controls.Adorners.RRMChrome"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:Notoric.Gui.Controls.Adorners"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <Style TargetType="{x:Type Shape}" x:Key="ThumbCorner">
            <Setter Property="SnapsToDevicePixels" Value="true" />
            <Setter Property="Stroke" Value="#FFC8C8C8" />
            <Setter Property="StrokeThickness" Value=".5" />
            <Setter Property="Width" Value="7" />
            <Setter Property="Height" Value="7" />
            <Setter Property="Margin" Value="-2" />
            <Setter Property="Fill">
                <Setter.Value>
                    <RadialGradientBrush Center="0.2, 0.2" GradientOrigin="0.2, 0.2" RadiusX="0.8" RadiusY="0.8">
                        <GradientStop Color="White" Offset="0.0" />
                        <GradientStop Color="Gray" Offset="0.8" />
                    </RadialGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="{x:Type Shape}" x:Key="ThumbSide">
            <Setter Property="SnapsToDevicePixels" Value="true" />
            <Setter Property="Stroke" Value="#FFC8C8C8" />
            <Setter Property="StrokeThickness" Value=".5" />
            <Setter Property="Width" Value="7" />
            <Setter Property="Height" Value="7" />
            <Setter Property="Margin" Value="-2" />
            <Setter Property="Fill">
                <Setter.Value>
                    <RadialGradientBrush Center="0.2, 0.2" GradientOrigin="0.2, 0.2" RadiusX="0.8" RadiusY="0.8">
                        <GradientStop Color="White" Offset="0.0" />
                        <GradientStop Color="Gray" Offset="0.8" />
                    </RadialGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid Opacity="0" Margin="-3">
            <local:RotateThumb Width="7"
                             Height="7"
                             Margin="0,-20,0,0"
                             Cursor="Hand"
                             VerticalAlignment="Top"
                             HorizontalAlignment="Center"
                             DragCompleted="RotateThumb_DragCompleted"/>
            <local:MoveThumb Height="3"
                             Cursor="SizeAll"
                             VerticalAlignment="Top"
                             HorizontalAlignment="Stretch"
                             DragCompleted="MoveThumb_DragCompleted"/>
            <local:ResizeThumb Height="7"
                             Width="7"
                             Cursor="SizeNS"
                             VerticalAlignment="Top"
                             HorizontalAlignment="Center"
                             DragCompleted="ResizeThumb_DragCompleted"/>
            <local:MoveThumb Width="3"
                             Cursor="SizeAll"
                             VerticalAlignment="Stretch"
                             HorizontalAlignment="Left"
                             DragCompleted="MoveThumb_DragCompleted"/>
            <local:ResizeThumb Height="7"
                             Width="7"
                             Cursor="SizeWE"
                             VerticalAlignment="Center"
                             HorizontalAlignment="Left"
                             DragCompleted="ResizeThumb_DragCompleted"/>
            <local:MoveThumb Width="3"
                             Cursor="SizeAll"
                             VerticalAlignment="Stretch"
                             HorizontalAlignment="Right"
                             DragCompleted="MoveThumb_DragCompleted"/>
            <local:ResizeThumb Height="7"
                             Width="7"
                             Cursor="SizeWE"
                             VerticalAlignment="Center"
                             HorizontalAlignment="Right"
                             DragCompleted="ResizeThumb_DragCompleted"/>
            <local:MoveThumb Height="3"
                             Cursor="SizeAll"
                             VerticalAlignment="Bottom"
                             HorizontalAlignment="Stretch"
                             DragCompleted="MoveThumb_DragCompleted"/>
            <local:ResizeThumb Height="7"
                             Width="7"
                             Cursor="SizeNS"
                             VerticalAlignment="Bottom"
                             HorizontalAlignment="Center"
                             DragCompleted="ResizeThumb_DragCompleted"/>
            <local:ResizeThumb Width="7"
                             Height="7"
                             Margin="-2"
                             Cursor="SizeNWSE"
                             VerticalAlignment="Top"
                             HorizontalAlignment="Left"
                             DragCompleted="ResizeThumb_DragCompleted"/>
            <local:ResizeThumb Width="7"
                             Height="7"
                             Margin="-2"
                             Cursor="SizeNESW"
                             VerticalAlignment="Top"
                             HorizontalAlignment="Right"
                             DragCompleted="ResizeThumb_DragCompleted"/>
            <local:ResizeThumb Width="7"
                             Height="7"
                             Margin="-2"
                             Cursor="SizeNESW"
                             VerticalAlignment="Bottom"
                             HorizontalAlignment="Left"
                             DragCompleted="ResizeThumb_DragCompleted"/>
            <local:ResizeThumb Width="7"
                             Height="7"
                             Margin="-2"
                             Cursor="SizeNWSE"
                             VerticalAlignment="Bottom"
                             HorizontalAlignment="Right"
                             DragCompleted="ResizeThumb_DragCompleted"/>
        </Grid>
        <Grid IsHitTestVisible="False" Opacity="1" Margin="-3">
            <Rectangle SnapsToDevicePixels="True"
                         StrokeThickness="1"
                         Margin="1"
                         Stroke="Navy"/>
            <Line StrokeThickness="1" X1="0" Y1="0" X2="0" Y2="20"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Top"
                    Margin="0,-19,0,0"
                    Stroke="White"/>
            <Ellipse Style="{StaticResource ThumbCorner}" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="-1,-20,0,0"/>
            <Ellipse Style="{StaticResource ThumbCorner}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
            <Ellipse Style="{StaticResource ThumbCorner}" HorizontalAlignment="Right" VerticalAlignment="Top"/>
            <Ellipse Style="{StaticResource ThumbCorner}" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
            <Ellipse Style="{StaticResource ThumbCorner}" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
            <Rectangle Style="{StaticResource ThumbSide}" HorizontalAlignment="Center" VerticalAlignment="Top"/>
            <Rectangle Style="{StaticResource ThumbSide}" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
            <Rectangle Style="{StaticResource ThumbSide}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
            <Rectangle Style="{StaticResource ThumbSide}" HorizontalAlignment="Right" VerticalAlignment="Center"/>
        </Grid>
    </Grid>
</UserControl>
